home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
answrbok
/
2_7.lha
/
2_7
/
2_7.c
next >
Wrap
Text File
|
1993-08-08
|
531b
|
23 lines
* Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
* The C++ Answer Book */
* Tony Hansen */
* All rights reserved. */
/ print out the exponent and mantissa of a double
include <stream.h>
include "2_7a.c" /* EXPAND */
oid prdouble(double d)
double_byte db;
db.d = d;
cout << d << "\n";
cout << (db.s_m.sign ? "-" : " ");
cout << hex(db.s_m.exponent, 3) << " ";
cout << hex(db.s_m.mantissa, 1);
for (int i = 2; i < sizeof(double); i++)
cout << hex(db.c[i], 3);
cout << "\n";